import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
	{
		path: '/',
		name: 'login',
		component: () => import("../views/login.vue")
	},
	{
		path: '/index',
		name: 'index',
		component: () => import("../views/home.vue"),
		children:[
			{
				name: "banner",
				path: "/banner",
				component: () => import("../views/banner.vue")
			},
			{
				name: "case",
				path: "/case",
				component: () => import("../views/case.vue")
			},
			{
				name: "serve",
				path: "/serve",
				component: () => import("../views/serve.vue")
			},
			{
				name: "recruitment",
				path: "/recruitment",
				component: () => import("../views/recruitment.vue")
			},
			{
				name: "job",
				path: "/job",
				component: () => import("../views/job.vue")
			},
			{
				name: "news",
				path: "/news",
				component: () => import("../views/news.vue")
			},
			{
				name: "team",
				path: "/team",
				component: () => import("../views/team.vue")
			},
		]
	},
];
/*
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location){
	return originalPush.call(this,location).catch(err=>err);
}
 */
const router = new VueRouter({
	mode: "hash",
	//base: process.env.BASE_URL,
	base: "/",
	routes,
});

export default router;